<?php
/**
 * @user:andy
 * @date:2021/8/4
 * @company:http://www.sjdphp.com
 * @desc:
 */

namespace app\admin\validate;


use think\Validate;

class AdValidate extends Validate
{
    protected $rule = [
        'ad_id' => 'require|number',
        'ad_path' => 'require',
        'cate_id' => 'require|number',
    ];

    protected $message = [
        'ad_id.require' => '广告ID不能为空',
        'ad_id.number'  => '广告ID格式错误',
        'ad_path.require' => '广告图不能为空',
        'cate_id.require' => '广告位置不能为空',
        'cate_id.number'  => '广告位置格式错误',
    ];

    protected $scene = [
        'add'  => ['ad_path','cate_id'],
        'edit' => ['ad_path','cate_id','ad_id'],
    ];
}